# from torchtext.datasets import AG_NEWS
# import pathlib
# now_folder = pathlib.Path(__file__).parent.joinpath('datasets','AG News','data')
# # train_iter, test_iter = AG_NEWS(root=r'D:\Datasets\AG News\data')
# train_iter, test_iter = AG_NEWS(root=now_folder)
# print(train_iter,test_iter)
# for x in test_iter:
#     print(x)

'''
测试加载 minifision


'''


import torch
from torch.utils.data import Dataset
from torchvision import datasets
from torchvision.transforms import ToTensor
import matplotlib.pyplot as plt
from torch.utils.data import DataLoader
from torch.utils.data.datapipes.iter.sharding import ShardingFilterIterDataPipe

training_data = datasets.FashionMNIST(
    root="data",
    train=True,
    download=True,
    transform=ToTensor()
)

test_data = datasets.FashionMNIST(
    root="data",
    train=False,
    download=True,
    transform=ToTensor()
)

# dataloader()
print(training_data[0][0].shape)
print(training_data[0][1])